<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
    <meta name="renderer" content="webkit">
    <!--国产浏览器高速模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>作业管理系统</title>

    <!-- 公共样式 开始 -->
    <link rel="stylesheet" type="text/css" href="../../css/base.css">
    <link rel="stylesheet" type="text/css" href="../../css/iconfont.css">
    <script type="text/javascript" src="../../framework/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css">
    <script type="text/javascript" src="../../layui/layui.js"></script>
    <!-- 滚动条插件 -->
    <link rel="stylesheet" type="text/css" href="../../css/jquery.mCustomScrollbar.css">
    <script src="../../framework/jquery-ui-1.10.4.min.js"></script>
    <script src="../../framework/jquery.mousewheel.min.js"></script>
    <script src="../../framework/jquery.mCustomScrollbar.min.js"></script>
    <script src="../../framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
    <!-- 公共样式 结束 -->
    <script type="text/javascript" src="../../framework/frameAll.js"></script>
    <style>
        /*.layui-form-label {*/
        /*width: 100px;*/
        /*}*/
        /*.layui-input-block {*/
        /*margin-left: 130px;*/
        /*}*/
    </style>
    <script type="text/javascript">
        $(function () {
            $("#deleteClass").click(function () {
                return confirm("你确定要删除[" + $(this).parent().parent().find("td:first").text() + "]?");
            });
        });
    </script>
</head>

<body>
<div class="layui-upload">
    <button type="button" class="layui-btn layui-btn-normal" id="uploadFile">选择文件</button>
    <button type="button" class="layui-btn" id="upload">开始上传</button>
</div>
<div class="cBody">
    <div class="console">
        <table class="layui-table-cell" id="demo" lay-filter="test"></table>
        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-sm" lay-event="edit">编辑</a>
            <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="del">删除</a>
        </script>
        <!-- layUI 分页模块 -->
        <div id="pages"></div>
    </div>
</div>
<script>
    layui.use(['table', 'upload'], function () {
        var table = layui.table,
            upload = layui.upload,
            title = "",
            content = "";
        //上传文件
        upload.render({
            elem: '#uploadFile',
            url: '/HwServlet.do?action=uploadFile', //改成您自己的上传接口
            auto: false,
            bindAction: '#upload',
            data: {
                title: title
            },
            done: function (res) {
                layer.msg(res.msg);
            }
        });
        table.render({
            elem: '#demo',
            height: "full-200",
            method: "get",
            request: {
                pageName: 'pageNo',//页码的参数名称，默认：page
                limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            where: {
                action: "page",
                content: content,
            },
            url: '/HwServlet.do',//数据接口
            page: true, //开启分页
            limits:[5,10,15,20,25,30,35,40,45,50],
            cellMinWidth: 100,
            cols: [[
                {title: '序号', type: 'numbers'},
                {field: 'title', title: '标题'},
                {field: 'teacherName', title: '老师姓名'},
                {field: 'describe', title: '作业内容'},
                {field: 'endTime', title: '截止日期'},
                {title: '操作', align: 'center', toolbar: '#barDemo', fixed: 'right'}
            ]]
        });
    });
</script>
</body>

</html>
